package cn.cheegon.blog.controller;

import cn.cheegon.blog.common.exception.Asserts;
import cn.cheegon.blog.model.UmsAdmin;
import cn.cheegon.blog.service.UmsAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Desc:
 * @Author: cheegon
 * @Date: Create in 2024/6/28  上午10:46
 */
@Controller
public class AdminController {

    @Autowired
    UmsAdminService umsAdminService;

    protected void checkAdmin() {
        UmsAdmin currUser = umsAdminService.getCurrUser();
        if (currUser == null||currUser.getType().equals("0")) {
            Asserts.fail("权限不足");
        }
    }
}
